View Javadoc
1 package org.webdocwf.util.smime.exception; 2 3 4 /*** 5 * Title: S/MIME Project 6 * Description: Creating S/MIME email transport capabilities. 7 * Copyright: Copyright (c) 2001 8 * @Author Vladimir Radisic 9 * @Version 2.0.1 10 */ 11 12 /*** 13 * ErrorStorage is used for storing SMIME error mesages used in construction 14 * of the SMIMEException. 15 */ 16 public class ErrorStorage { 17 18 /*** 19 * Returns error message text according to the given input number parameter. 20 * @param errNumber0 error number 21 * @return error message text coresponding to given error number 22 */ 23 public static String getErrorMesage(int errNumber0) { 24 String errMsg = ""; 25 26 switch (errNumber0) { 27 // org.webdocwf.util.smime.der.DERObject class 28 case 1000: 29 errMsg = "SMIME Error 1000: Identifier octet in DER encoding value " + 30 "can't be negative!"; 31 break; 32 33 case 1001: 34 errMsg = "SMIME Error 1001: Identifier octet in DER encoding value " + 35 "must be less than 255!"; 36 break; 37 38 case 1002: 39 errMsg = "SMIME Error 1002: Complex Identifier octets in DER encoding" + 40 " value are not suported in this version of DERObject!"; 41 break; 42 43 case 1003: 44 errMsg = "SMIME Error 1003: Can't use addContent method with Null DER" + 45 " object!"; 46 break; 47 48 case 1004: 49 errMsg = "SMIME Error 1004: Content of DER object must be present. Use" + 50 " addContent method or other constructor!"; 51 break; 52 53 // org.webdocwf.util.smime.der.DERClassContextSpecificPr class 54 case 1005: 55 errMsg = "SMIME Error 1005: Content could be added only once in " + 56 "primitive DERClassContextSpecific object!"; 57 break; 58 59 // org.webdocwf.util.smime.der.DERBitString class 60 case 1006: 61 errMsg = "SMIME Error 1006: Number of unused bits must be in range " + 62 "0-7!"; 63 break; 64 65 case 1007: 66 errMsg = "SMIME Error 1007: BitString can contain only characters 0 " + 67 "or 1!"; 68 break; 69 70 // org.webdocwf.util.smime.der.DERObjectIdentifier 71 case 1008: 72 errMsg = "SMIME Error 1008: No dots in \"DOT_SEPARATED_ARRAY\" " + 73 "construction!"; 74 break; 75 76 case 1009: 77 errMsg = "SMIME Error 1009: Allowable types of construction are: " + 78 "\"DOT_SEPARATED_ARRAY\" and \"NAME_STRING\"!"; 79 break; 80 81 case 1010: 82 errMsg = "Unknown type of Object identifier!"; 83 break; 84 85 // org.webdocwf.util.smime.crypto.SymmetricEncryption 86 case 1011: 87 errMsg = "SMIME Error 1011: Number of bytes in imported symmetric Key" + 88 " is incorect!"; 89 break; 90 91 // org.webdocwf.util.smime.crypto.SymmetricEncryption, 92 // org.webdocwf.util.smime.crypto.DESede3CBCParameter, 93 // org.webdocwf.util.smime.crypto.RC2CBCParameter 94 case 1012: 95 errMsg = "SMIME Error 1012: Number of bytes in imported IV must be 8!"; 96 break; 97 98 // org.webdocwf.util.smime.crypto.Algorithm, 99 // org.webdocwf.util.smime.cms.CMSEnvelopedDataSource 100 case 1013: 101 errMsg = "SMIME Error 1013: Allowed algorithm names are: DES_EDE3_CBC," + 102 " RC2_CBC or DES!"; 103 break; 104 105 // org.webdocwf.util.smime.crypto.Algorithm 106 // org.webdocwf.util.smime.crypto.RC2CBCParameter 107 case 1014: 108 errMsg = "SMIME Error 1014: Key size in bits for RC2 algorithm must " + 109 "be 40, 64 or 128!"; 110 break; 111 112 // org.webdocwf.util.smime.crypto.Algorithm 113 case 1015: 114 errMsg = "SMIME Error 1015: Key size in bits for DESede3 algorithm " + 115 "must be 128 or 192!"; 116 break; 117 118 case 1016: 119 errMsg = "SMIME Error 1016: Key size in bits for DES algorithm must " + 120 "be 56!"; 121 break; 122 123 // org.webdocwf.util.smime.cms.Attribute 124 case 1017: 125 errMsg = "SMIME Error 1017: No value for specified attribute!"; 126 break; 127 128 // org.webdocwf.util.smime.cms.ContentInfo 129 // org.webdocwf.util.smime.cms.EncapsulatedContentInfo 130 // org.webdocwf.util.smime.cms.EncryptedContentInfo 131 // org.webdocwf.util.smime.cms.EnvelopedData 132 // org.webdocwf.util.smime.cms.SignedData 133 case 1018: 134 errMsg = "SMIME Error 1018: Order of adding components is unproper!"; 135 break; 136 137 // org.webdocwf.util.smime.cms.CMSVersion 138 case 1019: 139 errMsg = "SMIME Error 1019: CMS Version must be 0,1,2,3 or 4!"; 140 break; 141 142 // org.webdocwf.util.smime.cms.CapabilitiesAttribute 143 case 1020: 144 errMsg = "SMIME Error 1020: Unknown type of Capabilities Attributes!"; 145 break; 146 147 // org.webdocwf.util.smime.cms.IssuerName 148 case 1021: 149 errMsg = "SMIME Error 1021: Function addAllRelativeDN was already " + 150 "performed!"; 151 break; 152 153 // org.webdocwf.util.smime.cms.KeyTransRecipientInfo 154 case 1022: 155 errMsg = "SMIME Error 1022: Recipient is alredy added!"; 156 break; 157 158 // org.webdocwf.util.smime.cms.RelativeDistinguishedName 159 case 1023: 160 errMsg = "SMIME Error 1023: This function can not be performed twice " + 161 "for one object!"; 162 break; 163 164 case 1024: 165 errMsg = "SMIME Error 1024: This function can be performed only with" + 166 " the simplest constructor!"; 167 break; 168 169 // org.webdocwf.util.smime.cms.SignedAttributes 170 case 1025: 171 errMsg = "SMIME Error 1025: No attribute was added!"; 172 break; 173 174 // org.webdocwf.util.smime.cms.SignerInfos 175 case 1026: 176 errMsg = "SMIME Error 1026: Missing owner's certificate!"; 177 break; 178 179 case 1027: 180 errMsg = "SMIME Error 1027: Missing owner's private key!"; 181 break; 182 183 // org.webdocwf.util.smime.cms.CMSSignedDataSource 184 case 1028: 185 errMsg = "SMIME Error 1028: Serial numbers of capabilities parameter " + 186 "must be between 0 and 5!"; 187 break; 188 189 case 1029: 190 errMsg = "SMIME Error 1029: Neither the same group of capabilities can " + 191 "be add twice, nor any group can be added after DEFAULT type!"; 192 break; 193 194 case 1030: 195 errMsg = "SMIME Error 1030: Type of set capabilities attributes must " + 196 "be: SIGNATURE, SYMMETRIC or ENCIPHER!"; 197 break; 198 199 case 1031: 200 errMsg = "SMIME Error 1031: Allowed signing algorithms are: " + 201 "SHA1_WITH_RSA, MD2_WITH_RSA, MD5_WITH_RSA or SHA1_WITH_DSA!"; 202 break; 203 204 // org.webdocwf.util.smime.util.Base64ForMime 205 case 1032: 206 errMsg = "SMIME Error 1032: Line breaks must be grather than 0 and " + 207 "less than or equal to 76!"; 208 break; 209 210 // org.webdocwf.util.smime.util.ByteArrayComparator 211 case 1033: 212 errMsg = "SMIME Error 1033: Searching array is bigger than / or equal to" + 213 " lookup array!"; 214 215 //org.webdocwf.util.smime.smime.EnvelopedSMIME 216 case 1034: 217 errMsg = "SMIME Error 1034: File does not exist!"; 218 break; 219 220 //org.webdocwf.util.smime.smime.EnvelopedSMIME 221 case 1035: 222 errMsg = "SMIME Error 1035: Parameter content shouldn't be null in " + 223 "setContent method!"; 224 break; 225 226 //org.webdocwf.util.smime.mail.MultipartGenerator 227 case 1036: 228 errMsg = "SMIME Error 1036: Unknown type of MIME message arrangement!" + 229 " Allowable types are: NETSCAPE and OUTLOOK!"; 230 break; 231 232 // org.webdocwf.util.smime.util.PFXUtils 233 case 1037: 234 errMsg = "SMIME Error 1037: Problem with aliases in pfx or p12 file!"; 235 break; 236 237 case 1038: 238 errMsg = "SMIME Error 1038: Problem with extracting certificate chain" + 239 " from .pfx or .p12 file!"; 240 break; 241 242 // org.webdocwf.util.smime.mail.EnvelopedAndSignedBodyPart 243 case 1039: 244 errMsg = "SMIME Error 1039: At least one recipient must be added " + 245 "before performing signing() method!"; 246 break; 247 248 // org.webdocwf.util.smime.mail.SignedAndEnvelopedBodyPart 249 case 1040: 250 errMsg = "SMIME Error 1040: At least one signer must be added before " + 251 "performing enveloping() method!"; 252 break; 253 254 //org.webdocwf.util.smime.smime.EnvelopedSMIME 255 //org.webdocwf.util.smime.smime.SignedSMIME 256 //org.webdocwf.util.smime.smime.SignedAndEnvelopedSMIME 257 case 1041: 258 errMsg = "SMIME Error 1041: FROM address or name of SMTP host is null!"; 259 break; 260 261 case 1042: 262 errMsg = "SMIME Error 1042: Type must be TO, CC, or BCC!"; 263 break; 264 265 case 1043: 266 errMsg = "SMIME Error 1043: One of recipients must be declared as TO " + 267 "recipient!"; 268 break; 269 270 case 1044: 271 errMsg = "SMIME Error 1044: There is no message for enveloping/signing!"; 272 break; 273 274 //org.webdocwf.util.smime.smime.SignedSMIME 275 //org.webdocwf.util.smime.smime.SignedAndEnvelopedSMIME 276 case 1045: 277 errMsg = "SMIME Error 1045: Method setCapabilities can be performed " + 278 "only three times for one signer!"; 279 break; 280 281 //org.webdocwf.util.smime.smime.SignedAndEnvelopedSMIME 282 case 1046: 283 errMsg = "SMIME Error 1046: Parameters for message protection order" + 284 " must be SIGN_FIRST or ENCRYPT_FIRST"; 285 break; 286 287 //-- unused ----------------------------------- 288 // case 1047: 289 // errMsg = "SMIME Error 1047: Explicit (external) signing type is not " + 290 // "implemented yet. Use implicit (internal) signing!"; 291 // break; 292 //org.webdocwf.util.smime.smime.EnvelopedSMIME 293 case 1048: 294 errMsg = "SMIME Error 1048: Content type must be \"text/plain\" or " + 295 "\"text/html\"!"; 296 break; 297 298 //org.webdocwf.util.smime.smime.EnvelopedSMIME 299 case 1049: 300 errMsg = "SMIME Error 1049: Content of message couldn't be added twice!"; 301 break; 302 303 case 1999: 304 errMsg = "SMIME Error 1999: Caused by non SMIMEException!"; 305 break; 306 307 default: 308 errMsg = "SMIME Error 9999: Unknown Error type: " + errNumber0 + "!"; 309 } 310 return errMsg; 311 } 312 }

This page was automatically generated by Maven